package neibulei;

import jiekoudeshiyongshili.One;

class A{
    int a = 0;

    public A(int aa) {
        this.a = aa;
    }

}

class one {
    int a = 0;
    int b = 10;
    public A aa;


    public one(int aa) {
        this.aa = new A(aa);
    }



    //静态内部类
//    static class inner_one {
//        int c = 2;
//
//        void text() {
//            one h = new one();
//            h.a = 100;
//        }
//    }
//实例内部类
    class three {
        int a = 22;
        int b = 33;

        void hh() {
            System.out.println(this.a);//这是外部类的成员
            System.out.println(one.this.a);//这是内部类的成员
        }
    }
}
class five{
    void hh(){
        System.out.println("hh");
    };
    static class inner_five{
        void hhh() {
            System.out.println("hhh");
        }
    }

}

interface six{
    void hh();
}

public class first {

    public static void main(String[] args) {

    }
    public static void maimmn(String[] args) {
        //静态内部类
        five.inner_five h = new five.inner_five();
        h.hhh();
        five hh = new five();
        hh.hh();
    }
    public static void mammin(String[] args) {
        //实例内部内
        one h = new one(2);
        one.three hh = h.new three();
        hh.hh();

        System.out.println(h.aa.a);

    }

    //匿名内部类
    public static void masin(String[] args) {
//        new five(){
//
//        }.hh();
        six a = new six() {
            public void hh() {
                System.out.println("hh");
            }
        };
        a.hh();
    }

    public static void jubu(String[] args) {

        class oone {
            int a = 10;
        }
        oone n = new oone();
        System.out.println(n.a);

    }

    public static void mssain(String[] args) {
        //静态内部类
//        one.inner_one hh = new one.inner_one();
//        hh.text();
        //实例内部类的实例化
        one hh = new one(1);
        one.three hhh = hh.new three();//要用实际的外部对象去new内部的对象
    }
}

